namespace Terra.Core.Infrastructure.MessageQueue;

/// <summary>
/// 消息总线接口
/// </summary>
public interface IMessageBus
{
    Task PublishAsync<T>(string topic, T message, IDictionary<string, object> headers = null);
    Task SubscribeAsync<T>(string topic, Func<T, IDictionary<string, object>, Task> handler);
    Task UnsubscribeAsync(string topic);
    Task<bool> IsSubscribedAsync(string topic);
}